package com.vidmt.api.modules.sys.entity.sub;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSONObject;
import com.vidmt.api.modules.sys.Enums.PayType;
import com.vidmt.api.modules.sys.entity.Order;
import com.vidmt.api.modules.sys.utils.VUtil;

public class IapOrder extends Order {
	private static final Logger log = LoggerFactory.getLogger(Order.class);

	private static final long serialVersionUID = 1L;
	private static float COMMISSION_RATE=0.3F;
	public IapOrder() {
		super();
		this.setPayType(PayType.IAP);
	}
	@Override
	public Integer getRealFee() {
		return (int) (super.getRealFee() * (1-COMMISSION_RATE));
	}
	@Override
	public JSONObject toPayinfo() {
		JSONObject json = new JSONObject();
		json.put("notify_url", VUtil.getNotifyUrl(PayType.IAP));
		json.put("out_trade_no", this.id);
		return json;
	}
}
